import request from '@/utils/request'

export const addCourseInfo = (data)=>{
  return request({
    url:`eduservice/course/addCourseInfo`,
    method:'post',
    data
  })
}

export const getCourseInfo = (data)=>{
  return request({
    url:`eduservice/course/getCourseInfo/${data}`,
    method:'get',
  })
}

export const getPublishCourse = (data)=>{
  return request({
    url:`eduservice/course/getPublishCourse/${data}`,
    method:'get',
  })
}

export const updateCourseInfo = (data)=>{
  return request({
    url:`eduservice/course/updateCourseInfo`,
    method:'put',
    data
  })
}

export const publishCourse = (data)=>{
  return request({
    url:`eduservice/course/publishCourse/${data}`,
    method:'put'
  })
}

export const deleteCourse = (data)=>{
  return request({
    url:`eduservice/course/deleteCourse/${data}`,
    method:'delete'
  })
}

export const queryCourseList = (data)=>{
  return request({
    url:`eduservice/course/queryCourseList`,
    method:'get',
    params:data
  })
}


export default { addCourseInfo, getCourseInfo, updateCourseInfo, getPublishCourse, publishCourse, queryCourseList, deleteCourse }